#ifndef _CONEXIONDTN_H_
#define _CONEXIONDTN_H_

#ifndef PATH_MAX
#define PATH_MAX 1024
#endif

#include <string>
#include <dtn/dtn_api.h>
#include <vector>

class ConexionDTN{
    private:
    dtn_handle_t handle;
    std::string source_eid;
    std::string dst_eid;
    dtn_bundle_spec_t bundle_spec;
    dtn_bundle_payload_t bundle_payload;
    dtn_bundle_id_t bundle_id;

    dtn_endpoint_id_t * parse_eid(dtn_handle_t handle, dtn_endpoint_id_t* eid, const char *str);
    void print_eid(const char *  label, dtn_endpoint_id_t * eid);

    public:
    ConexionDTN(std::string nombre);

    int connect(std::string dst_eid);
    int send(const char* buffer, size_t size);

    int bind();
    void receive(std::vector<char> &buffer);
    void receive(std::vector<char> &buffer, std::string &uri);
    int disconnect();
};

#endif /* _CONEXIONDTN_H_ */
